package com.collect.tanzania.zhiAdater.zhiLevelDetail;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.tanzania.R;
import com.collect.tanzania.zhiBean.zhiReceive.ZHIRCollecterPerformanceEntity;

public class ZHILevelDetailCollecterMember extends BaseQuickAdapter<ZHIRCollecterPerformanceEntity, BaseViewHolder> {

    public ZHILevelDetailCollecterMember() {
        super(R.layout.item_level_detail_column_5_not_ext, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, ZHIRCollecterPerformanceEntity item) {
        helper.setText(R.id.tv_col_0, item.getAssignDateFormatDisplay());
        helper.setText(R.id.tv_col_1, item.getAssignNumFormatInt()+"");
        helper.setText(R.id.tv_col_2, item.getTaskNumFormatInt()+"");
        helper.setText(R.id.tv_col_3, item.getRepayNumFormatInt()+"");
        helper.setText(R.id.tv_col_4, item.getBonusFormat());

        ImageView iv_ext_img = helper.getView(R.id.iv_ext_img);
        if (item.isGreenCard() || item.isYellowCard()) {
            iv_ext_img.setVisibility(View.VISIBLE);

            if (item.isYellowCard()) {
                iv_ext_img.setImageResource(R.drawable.ic_136);
            } else {
                iv_ext_img.setImageResource(R.drawable.ic_137);
            }
        } else {
            iv_ext_img.setVisibility(View.GONE);
        }
    }
}
